home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / answrbok / 7_10.lha / 7_10 / p_kill.c < prev    next >
Text File  |  1993-08-08  |  859b  |  25 lines

  1. * Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
  2. * The C++ Answer Book */
  3. * Tony Hansen */
  4. * All rights reserved. */
  5. include <process.h>
  6. include <debug.h>    /* DELETE */
  7. oid process::kill(long res)
  8.  
  9.    if (debug) /*DELETE*/ cerr << "process" << this << "::kill(" << res << ")\n";
  10.    if (debug) /*DELETE*/ cerr << "\t" << this << "->t_curstate == " << ps_print(t_curstate) << "\n";
  11.    if (t_curstate == TASK_RUNNABLE)
  12. rmfromlist(this, &t_runprocesses);
  13.  
  14.    else if (t_curstate == TASK_IDLE)
  15. rmfromlist(this, &t_waitprocesses);
  16.  
  17.    t_curstate = TASK_TERMINATED;
  18.    t_next = t_doneprocesses;
  19.    t_doneprocesses = this;
  20.    if (debug) /*DELETE*/ cerr << "\t" << this << "->t_curstate <- " << ps_print(t_curstate) << "\n";
  21.    t_result = res;
  22.    alert();
  23.    if (debug) /*DELETE*/ cerr << "<<<< process" << this << "::kill(" << res << ")\n";
  24.  
  25.